package org.jeecg.modules.demo.ipds.entity.vo;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.modules.demo.ipds.entity.ByteFrameZu;
import org.jeecgframework.poi.excel.annotation.Excel;

import javax.xml.bind.annotation.*;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * @Description: 字节列表
 * @Author: jeecg-boot
 * @Date:   2024-01-31
 * @Version: V1.0
 */
@Data
@TableName("tree_byte_list")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tree_byte_list对象", description="字节列表")
@XmlRootElement(name = "ByteItem")
@XmlAccessorType(XmlAccessType.FIELD)
public class TreeByteListVo implements Serializable {
    private static final long serialVersionUID = 1L;



	/**序号*/
	@Excel(name = "序号", width = 15)
    @ApiModelProperty(value = "序号")
    @XmlAttribute(name = "sn")
    private java.lang.String sn;
	/**字节名称*/
	@Excel(name = "字节名称", width = 15)
    @ApiModelProperty(value = "字节名称")
    @XmlAttribute(name = "byteName")
    private java.lang.String byteName;
	/**数据类型*/
	@Excel(name = "数据类型", width = 15)
    @ApiModelProperty(value = "数据类型")
    @XmlAttribute(name = "dataType")
    private java.lang.String dataType;
	/**数据范围*/
	@Excel(name = "数据范围", width = 15)
    @ApiModelProperty(value = "数据范围")
    @XmlAttribute(name = "valueScope")
    private java.lang.String valueScope;
	/**分辨率*/
	@Excel(name = "分辨率", width = 15)
    @ApiModelProperty(value = "分辨率")
    @XmlAttribute(name = "resolutionRatio")
    private java.lang.String resolutionRatio;
	/**有无符号*/
	@Excel(name = "有无符号", width = 15)
    @XmlAttribute(name = "isSymbolString")
    private  java.lang.String isSymbolString;

    private byte[] isSymbol;

    public byte[] getIsSymbol(){
        if(isSymbolString==null){
            return null;
        }
        try {
            return isSymbolString.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getIsSymbolString(){
        if(isSymbol==null || isSymbol.length==0){
            return "";
        }
        try {
            return new String(isSymbol,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
	/**字段类型*/
	@Excel(name = "字段类型", width = 15)
    @ApiModelProperty(value = "字段类型")
    @XmlAttribute(name = "fieldType")
    private java.lang.String fieldType;
	/**字段类型值*/
	@Excel(name = "字段类型值", width = 15)
    @ApiModelProperty(value = "字段类型值")
    @XmlAttribute(name = "fieldTypeValue")
    private java.lang.String fieldTypeValue;
	/**默认值*/
	@Excel(name = "默认值", width = 15)
    @ApiModelProperty(value = "默认值")
    @XmlAttribute(name = "defaultValue")
    private java.lang.String defaultValue;
	/**单位*/
	@Excel(name = "单位", width = 15)
    @ApiModelProperty(value = "单位")
    @XmlAttribute(name = "unit")
    private java.lang.String unit;
	/**复用字段*/
	@Excel(name = "复用字段", width = 15)
    @XmlAttribute(name = "reuseFieldString")
    private  java.lang.String reuseFieldString;

    @ApiModelProperty(value = "分辨率最大长度")
    @XmlAttribute(name = "resolutionRatioLength")
    private  Integer resolutionRatioLength;

    private String reuseField;


	/**字段长度*/
	@Excel(name = "字段长度", width = 15)
    @ApiModelProperty(value = "字段长度")
    @XmlAttribute(name = "fieldLength")
    private java.lang.String fieldLength;
	/**注释*/
	@Excel(name = "注释", width = 15)
    @ApiModelProperty(value = "注释")
    @XmlAttribute(name = "annotation")
    private java.lang.String annotation;
	/**扩展字段*/
	@Excel(name = "扩展字段", width = 15)
    @ApiModelProperty(value = "扩展字段")
    @XmlAttribute(name = "extendField")
    private String extendField;

    @ApiModelProperty
    @XmlElement(name = "SubframeItem")
    private List<ByteFrameZu> byteFrameZuList;

	/**协议树ID*/
	@Excel(name = "协议树ID", width = 15)
    @ApiModelProperty(value = "协议树ID")
    private java.lang.String ipTreeId;


    @XmlElement(name = "ByteItem")
    private java.lang.String pid;

    @XmlAttribute(name = "indexSx")
    private java.lang.Integer indexSx;

    @XmlElement(name = "ByteItem")
    private List<BitListVo> bitLists;




}
